package com.feizhoutuobang.shapeline.util.image;

import java.awt.image.BufferedImage;
import java.io.FileOutputStream;
import java.io.IOException;

import com.sun.image.codec.jpeg.ImageFormatException;
import com.sun.image.codec.jpeg.JPEGCodec;
import com.sun.image.codec.jpeg.JPEGImageEncoder;

public class JpegNetImage extends NetImage {
	
	public JpegNetImage(String url) {
		super(url);
	}
	
	public JpegNetImage(){
	}
	
	//JPEG编码
	@Override
	protected void encode(FileOutputStream out, BufferedImage bufferedImage) throws ImageFormatException, IOException {
		JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(out);
		encoder.encode(bufferedImage);
	}
}
